<template>
	<view class="p-item" @click="toDetail(data.id)">
		<view class="img">
			<image :src="data.commodityPicture?data.commodityPicture:''" mode=""></image>
		</view>
		<view class="name">
			<text>{{data.name}}</text>
		</view>
		<view class="price">
			<text class="pl">¥{{data.count}}</text>
			<text class="pr">销量：52件</text>
		</view>
		<view class="yong">
			<text class="yl">¥{{data.price}}</text>
			<text class="yr">+</text>
		</view>
	</view>
</template>

<script>
	export default {
		props:['data'],
		data() {
			return {
				
			};
		},
		methods: {
			toDetail(id){
				uni.navigateTo({
					url: "../../pages/shop/product_detail"
				});
			}
		}
	}
</script>

<style>
.p-item {
	width: calc(44%);
	min-height: 460upx;
	background-color: #fff;
	padding: calc(2%);
	margin: calc(1%);
	margin-bottom: 10upx;
	float: left;
}
.p-item:nth-child(odd){
	/* margin-left: 10upx; */
}
.p-item .img {
	width: 100%;
	height: 308upx;
	background-color: #A2A2A2;
}
.p-item .img image {
	width: 100%;
	height: 100%;
}
.p-item .name {
	line-height: 60upx;
}
.p-item .price {
	height: 40upx;
	line-height: 40upx;
}
.p-item .price .pl {
	float: left;
	font-size: 40upx;
	color: #2E2E2E;
}
.p-item .price .pr {
	color: #999;
	font-size: 20upx;
	float: right;
}
.p-item .yong .yl {
	font-size: 24upx;
	color: #999;
	float: left;
	text-decoration: line-through;
}
.p-item .yong .yr {
	float: right;
	color: #F83E5D;
	font-size: 26upx;
}
</style>
